<?php


// $xml = new DOMDocument('1.0');
// $xml->validateOnParse = true;
// $xml->formatOutput = true;

// $xml->load('xml_template.xml');
// $xpath = new DOMXPath($xml);


    error_reporting(E_ALL);
    include_once('simple_html_dom.php');

 

    if(isset($_POST['imeSektora'])) {
        $imeSektora = $_POST['imeSektora'];
    } else {
        $imeSektora = '';
    };
    if(isset($_POST['sektorText'])) {
        $sektorText = $_POST['sektorText'];
    } else {
        $sektorText = '';
    };

    //$filename = 'word/text-'.$imeSektora.'.xml';
    $filename = 'word/text-sektor.xml';
    $fp = fopen("$filename","w");
    fwrite($fp,$sektorText);
    fclose($fp);

    //echo $date;
    echo json_encode($output,JSON_FORCE_OBJECT);

    //$xml->save($filename);
?>
